<%@ include file="/common/taglibs.jsp"%>
<%@ page language="java" import="java.util.*" errorPage="/error.jsp"  pageEncoding="utf8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US" lang="en-US"
	dir="ltr">
	<head>

		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
		<link rel="stylesheet" href="<c:url value="/css/shopadmin.css"/>"
			type="text/css" />

	</head>
	<body style="">
		<div id="headBar" class="head_content"></div>
		<div class="main_content" id="main">
			<form action="mt_pointSetting_save.html" method="post" onsubmit="return checkForm();"
				id="pointSettingForm">
				 <input name="systemSettings.settingId"
					value="${systemSettings.settingId }" type="hidden" />
				<input name="systemSettings.settingCat"
					value="${systemSettings.settingCat }" type="hidden" />
				<input name="systemSettings.name" value="${systemSettings.name}"
					type="hidden" />
				<div class="tableform">
					<div class="division">
						<table>
							<tbody>
								<tr>
									<th>
										积分计算方式：
									</th>
									<td id="p_a">
										<label>
											<input type="radio" value="unuse" name="systemSettings.data" checked
												id="point_unuse" />
											不使用积分
										</label>

										<br>
											<label>
												<input type="radio" value="use" name="systemSettings.data"
													id="point_use" />
												按订单商品总价格计算积分
											</label>
									</td>
								</tr>
								<tr style="display: none;" id="point_rate_tr">
									<th>
										积分换算比率：
									</th>
									<td>
										<input name="pointRateSetting.settingId"
											value="${pointRateSetting.settingId}" type="hidden" />
										<input name="pointRateSetting.settingCat"
											value="${pointRateSetting.settingCat}" type="hidden" />
										<input name="pointRateSetting.name"
											value="${pointRateSetting.name}" type="hidden" />
										<input type="text" value="${pointRateSetting.data}" id="point_rate_data"
											style="width: 50px;" name="pointRateSetting.data"
											class="x-input" />
											<span class="notice-inline"> <span id=" ">
													 
											</span> <br>
													<span class="fontcolorGray">订单所得积分 = 订单商品总价格 X积分换算比率</span>
											</span>
									</td>
								</tr>
							</tbody>
						</table>
					</div>
					<div class="table-action">
						<button class="btn" type="submit">
							<span><span>提交</span> </span>
						</button>
					</div>
				</div>
			</form>
		</div>
		<div id="footBar" class="foot_content"></div>



		<div class="foot_content" id="footBar" style="font-size: 0px;"></div>
		<script type="text/javascript"
			src="<c:url value='/scripts/jquery-1.4.2.js'/>"></script>
		<%@ include file="/jsp/admin/common/messages.jsp"%>

		<script type="text/javascript">
	$("#point_use").click( function () { 
		$('#point_rate_tr').css('display','');
	 });
	 $("#point_unuse").click( function () { 
		$('#point_rate_tr').css('display','none');
	 });
	 <c:if test="${systemSettings.data=='use'}">
	 	$('#point_rate_tr').css('display','');
	 	$('#point_use').attr("checked", true);
	 </c:if>
	 $("#point_rate_data").blur( checkPointRate );
	 function checkPointRate(){ 
		var point_rate = $('#point_rate_data').val().trim();
		if(point_rate==''||isNaN(point_rate)||parseInt(point_rate)<0){
			alert('请输入一个正整数');			
			$('#point_rate_data').val('');	
			return false;
		}
		return true;
	 }
	 function checkForm(){
	 	if($('#point_use').attr("checked")){
	 		return checkPointRate();
	 	}
	 	return true;
	 }
</script>
	</body>
</html>